<?php
namespace Admin\Controller;
use Think\Controller;
class UserController extends Controller {
    public function user_list(){
    	$sql = "SELECT `id`, `username`, `sex`, `phone`, `email`, `province`, `city`, `introduce`, `regist_time`, `score` FROM `user`";
    	$model = M('user');
    	$result = $model->query($sql);
    	foreach ($result as $key => $value) {
    				
    		$result[$key]['regist_time'] = date('Y-m-d h:i:s', $value['regist_time']); 		
    	}
    	// var_dump($result);
    	$this->assign('result',$result);
    	$this->display();
    }
    public function user_add(){
    	if (!empty($_GET['id'])) {
    		$sql = "SELECT `id`, `username`, `sex`, `phone`, `email`, `province`, `city`, `introduce` FROM `user` WHERE `id` = '{$_GET['id']}'";
    		$model = M('user');
    		$result = $model->query($sql);
    		$result = current($result);
    		$this->assign('result',$result);
    		
    	}
    	if(IS_POST){




    	}else{
    		$this->display();
    	}
    	
    }
}
?>